package com.example.demo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 消息类
 * </p>
 *
 * @author cy
 * @since 2020-08-16
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class Information extends Model<Information> {

    private static final long serialVersionUID = 1L;

    public static final int NO_READ=0;

    public static final int READ=1;

    /**
     * 消息id
     */
    @TableId(value = "information_id", type = IdType.AUTO)
    private Integer informationId;

    /**
     * 接受消息的用户id
     */
    private Integer userId;

    /**
     * 信息
     */
    private String message;

    /**
     * 发送时间
     */
    private LocalDateTime time;

    /**
     * 是否已读，1是已读，0是未读
     */
    private Integer state;


    @Override
    protected Serializable pkVal() {
        return this.informationId;
    }

}
